package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;

import java.awt.Font;

import javax.swing.SwingConstants;
import javax.swing.JTable;
import javax.swing.JButton;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class JFrameAdminUserManagement extends JFrame {

	private JPanel contentPane;
	private JTable table;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JFrameAdminUserManagement frame = new JFrameAdminUserManagement();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JFrameAdminUserManagement() {
		setTitle("Admin - User management");
		addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				JFrameAdminMainPage jFrameAdminMainPage = new JFrameAdminMainPage();
				jFrameAdminMainPage.setVisible(true);
			}
		});
		setType(Type.POPUP);
		setResizable(false);

		setBounds(100, 100, 600, 500);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JLabel lblUserManagement = new JLabel("User Management");
		lblUserManagement.setHorizontalAlignment(SwingConstants.CENTER);
		lblUserManagement.setFont(new Font("Tahoma", Font.BOLD, 30));
		lblUserManagement.setBounds(100, 10, 400, 50);
		contentPane.add(lblUserManagement);

		table = new JTable();
		table.setBounds(50, 80, 500, 225);
		contentPane.add(table);

		JButton btnCreateUser = new JButton("Create User");
		btnCreateUser.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				JFrameAdminCreateNewUser jFrameAdminCreateNewUser = new JFrameAdminCreateNewUser();
				jFrameAdminCreateNewUser.setVisible(true);
				dispose();
			}
		});
		btnCreateUser.setFont(new Font("Tahoma", Font.PLAIN, 15));
		btnCreateUser.setBounds(50, 325, 200, 50);
		contentPane.add(btnCreateUser);

		JButton btnUpdateUser = new JButton("Update User");
		btnUpdateUser.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
			}
		});
		btnUpdateUser.setFont(new Font("Tahoma", Font.PLAIN, 15));
		btnUpdateUser.setBounds(50, 400, 200, 50);
		contentPane.add(btnUpdateUser);

		JButton btnAllowAccess = new JButton("Allow Access To User");
		btnAllowAccess.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
			}
		});
		btnAllowAccess.setFont(new Font("Tahoma", Font.PLAIN, 15));
		btnAllowAccess.setBounds(350, 325, 200, 50);
		contentPane.add(btnAllowAccess);

		JButton btnBackToMenu = new JButton("Back to Menu");
		btnBackToMenu.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
			}
		});
		btnBackToMenu.setFont(new Font("Tahoma", Font.PLAIN, 15));
		btnBackToMenu.setBounds(350, 400, 200, 50);
		contentPane.add(btnBackToMenu);
	}
}
